#version 330 core

layout(location = 0)in vec3 v_m;
layout(location = 1)in vec3 n_m;

out vec3 v_w;
out vec3 n_w;

uniform mat4 MVP;
uniform mat4 M;

void main(){
 	gl_Position = vec4(v_m.xyz, 1.0);
 	v_w = vec4(M * gl_Position).xyz;
	gl_Position = MVP * gl_Position;
 	n_w = vec4(M * vec4(n_m, 0.0)).xyz;
}